<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<script type="text/javascript">

$(function(){
	var provinceVal = '${Users.province}';
	var cityVal = '${Users.city}';
	var countyVal = '${Users.county}';
	//省
    $('#provinceId').combobox({
        url:'<c:url value="/users/findAdmdivision.do"/>',  
        editable:false,
        panelHeight: 'auto',
        valueField:'adcode',
        textField:'adname',
        onSelect:function(record){
            $('#cityId').combobox({url:'<c:url value="/users/findAdmdivision.do"/>?parentcode='+record.adcode}).combobox('clear');
        },
        onLoadSuccess: function(){  
            if(provinceVal != ''){
            	$('#provinceId').combobox('select', provinceVal);
            }
	    }
    });
    //市区
    $('#cityId').combobox({
    	editable:false,
    	panelHeight: 'auto',
    	valueField:'adcode',
        textField:'adname',
        onSelect:function(record){
	        $('#countyId').combobox({url:'<c:url value="/users/findAdmdivision.do"/>?parentcode='+record.adcode}).combobox('clear');
	    },
	    onLoadSuccess: function(){  
            if(cityVal != ''){
            	$('#cityId').combobox('select', cityVal);
            }
	    }
    });
    //县
    $('#countyId').combobox({
    	editable:false,
    	panelHeight: 'auto',
    	valueField:'adcode',
        textField:'adname',
        onLoadSuccess: function(){  
	        if(countyVal != ''){
	        	$('#countyId').combobox('select', countyVal);
	        }
    }
    });
});


</script>

<div region="north" split="true" style="padding: 5px;">
<form id="UsersForm" method="post" style="margin:0;padding:0">
	<input type="hidden" name="id" value="${Users.id }">
	<table align="center">
			<tr>
				<td>家长编号：</td>
				<td><input type="text"  name="code" readonly="readonly" value="${Users.code }" style="width: 150px;" title="自动生成"/></td>
				<td>家长姓名：</td>
				<td><input class="easyui-validatebox" type="text" required="true" name="name" value="${Users.name }" style="width: 150px;" /></td>
			</tr>
			<tr>
				<td>登陆密码：</td>
				<td><input class="easyui-validatebox" type="password" required="true" name="password" value="${Users.password }" style="width: 150px;" /></td>
				<td>与孩子关系：</td>
				<td><input class="easyui-validatebox" type="text" required="true" name="relation" value="${Users.relation }" style="width: 150px;" /></td>
			</tr>
			<tr>
				<td>省：</td>
				<td><input id="provinceId"  type="text" required="true" name="province" style="width: 150px;" /> 
				</td>
				<td>市：</td>
				<td><input id="cityId" type="text" required="true" name="city" style="width: 150px;" /></td>
			</tr>
			<tr>
				<td>县：</td>
				<td><input id="countyId" type="text" required="true" name="county" style="width: 150px;" /></td>
			</tr>
			<tr>
				<td>手机号码 ：</td>
				<td><input class="easyui-numberbox" type="text" required="true" name="mobile" value="${Users.mobile }" style="width: 150px;" maxlength="11"/></td>
				<td>联系电话：</td>
				<td><input class="easyui-validatebox" type="text" name="tel" value="${Users.tel }" style="width: 150px;" maxlength="20"/></td>
			</tr>
			<tr>
				<td>邮箱：</td>
				<td><input class="easyui-validatebox" type="text"  name="email" value="${Users.email }" style="width: 150px;" maxlength="30"/></td>
				<td>家庭住址：</td>
				<td><input class="easyui-validatebox" type="text"  name="address" value="${Users.address }" style="width: 150px;" maxlength="30"/></td>
			</tr>
			<tr>
				<td>生日：</td>
				<td><input class="easyui-validatebox Wdate" type="text"  name="birthday" value="${Users.birthday }" style="width: 150px;" 
					readonly="readonly"	onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
				</td>
				<td>孩子性别：</td>
				<td>
				<input id="sex_combobo" class="easyui-combobox" type="text" required="true" name="sex" style="width: 150px;" data-options="  
					        valueField: 'value',  
					        textField: 'name',  
					        editable:false,
					        panelHeight: 'auto',
					        data: [{'name':'男', 'value':'男'},{'name':'女', 'value':'女'}],  
					        onLoadSuccess: function(){  
					            $('#sex_combobo').combobox('select', '${Users.sex }');
					}" /> 
				</td>
			</tr>
			<tr>
				<td>现就读班级：</td>
				<td><input class="easyui-validatebox" type="text"  name="schoolClass" value="${Users.schoolClass }" style="width: 150px;" /></td>
				<td>孩子接触网络时间：</td>
				<td><input class="easyui-validatebox" type="text"  name="beginTime" value="${Users.beginTime }" style="width: 150px;" /></td>
			</tr>
			<tr>
				<td>受控用户：</td>
				<td><input class="easyui-validatebox" type="text"  name="controlUser" value="${Users.controlUser }" style="width: 150px;" /></td>
				<td>销售人员：</td>
				<td>
					<input id="saleUser_id" class="easyui-combobox" required="true" name="saleUser.uuid" style="width: 150px;" data-options="  
					        valueField: 'uuid',  
					        textField: 'name',  
					        editable:false,
					        panelHeight: 'auto',
					        data: ${SysUserJson},  
					        onLoadSuccess: function(){  
					           $('#saleUser_id').combobox('select', '${Users.saleUser.uuid }');
					}" /> 
				</td>
			</tr>
			<tr>
				<td>市场部经理：</td>
				<td>
				<input id="managerUser_uuid" class="easyui-combobox" required="true" name="managerUser.uuid" style="width: 150px;" data-options="  
					        valueField: 'uuid',  
					        textField: 'name',  
					        editable:false,
					        panelHeight: 'auto',
					        data: ${SysUserJson},  
					        onLoadSuccess: function(){  
					            $('#managerUser_uuid').combobox('select', '${Users.managerUser.uuid }');
					}" /> 
				</td>
				<td>服务专员：</td>
				<td>
				<input id="assistantUser_uuid" class="easyui-combobox" required="true" name="assistantUser.uuid" style="width: 150px;" data-options="  
					        valueField: 'uuid',  
					        textField: 'name',  
					        editable:false,
					        panelHeight: 'auto',
					        data: ${SysUserJson},  
					        onLoadSuccess: function(){  
					        	$('#assistantUser_uuid').combobox('select', '${Users.assistantUser.uuid }');
					}" /> 
				</td>
			</tr>
	</table>
</form>
</div>
